import 'package:cat_eye/base/base_refresh_view_model.dart';
import 'package:cat_eye/base/base_view_model.dart';
import 'package:cat_eye/bean/home_body_bean.dart';
import 'package:flutter/material.dart';

/*
* @Package: view_model.hot_view_model
* @ClassName: hot_list_view_model
* @Author: szj
* @CreateDate: 8/4/21 1:59 PM
* TODO 热门-列表
*/
class HotListViewModel extends BaseViewModel {
  String url;

  List<ItemList> itemList = [];

  HotListViewModel(this.url);

  @override
  String get httpUrl => url;

  @override
  void refresh() {
    if (itemList.length > 0) itemList.clear();
    super.refresh();
  }

  @override
  void successJsonData(json) {
    var bean = IssueList.fromJson(json);

    itemList.addAll(bean.itemList);
  }

}